unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,System.RegularExpressionsCore;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  PerlA:TPerlRegEx;
begin
  PerlA:=TPerlRegEx.Create;
  PerlA.Subject:='Sheet156';
  PerlA.RegEx  :='^Sheet\d+';

  while PerlA.MatchAgain do
  begin
    ShowMessage(PerlA.MatchedText);
  end;

  FreeAndNil(PerlA);
end;

end.
